#include <iostream>
using namespace std;
//2 3 5 7 11
int month_28[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int month_29[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
typedef struct
{
    int Syear;
    int Smonth;
    int Sday;
} S;
S from, to;

//闰年判定
bool isLeap(int year)
{
    return (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0));
}
//素数判定
bool isPrime(int month)
{
    if (month == 2 || month == 3 || month == 5 || month == 7 || month == 11)
        return true;
    else
        return false;
}

//计算整年
int AllYear(int year1, int year2)
{
    int sum = 0;
    for (int i = year1; i < year2; i++)
    {
        if (isLeap(i))
        {
            sum += 31 * 2 + 29 + 31 + 30 * 2 + 31 + 30 * 2 + 31 + 31 * 2 + 30 * 2 + 31 * 2 + 30 + 31 * 2;
        }
        else
        {
            sum += 31 * 2 + 28 + 31 + 30 * 2 + 31 + 30 * 2 + 31 + 31 * 2 + 30 * 2 + 31 * 2 + 30 + 31 * 2;
        }
    }
    return sum;
}
//计算整月
int AllMonth(int month1, int month2, int Myear)
{
    int sum = 0;
    bool flag = isLeap(Myear);
    for (int i = month1; i < month2; i++)
    {
        if (i == 2)
        {
            if (flag)
                sum += month_29[i - 1];
            else
                sum += month_28[i - 1];
        }
        else
        {
            if (isPrime(i))
                sum += flag ? (month_29[i - 1]) : (month_28[i - 1]);
            else
                sum += flag ? (month_29[i - 1] * 2) : (month_28[i - 1] * 2);
        }
    }
    return sum;
}
//计算日
int Day(int day1, int day2, int month)
{
    int sum = 0;
    bool flag = isPrime(month);
    for (int i = day1; i <= day2; i++)
    {
        sum += flag ? 1 : 2;
    }
    return sum;
}

int main()
{
    int sum = 0;
    while (cin >> from.Syear >> from.Smonth >> from.Sday >> to.Syear >> to.Smonth >> to.Sday)
    {
        sum += AllYear(from.Syear, to.Syear);
        sum += AllMonth(from.Smonth, to.Smonth, to.Syear);
        sum += Day(from.Sday, to.Sday, to.Smonth);
        printf("%d\n", sum);
        sum = 0;
    }
}